#pragma once
#include "mytypes.h"
#include "Polygon.h"
#include "PolygonView.h"
#include "RigidBody.h"
#include "Collision.h"
#include "Dynamics.h"
#include "RigidCollision.h"

namespace poly
{
	class RigidCircle;
	class RigidPoly : public IDynamic, public IRigidCollider
	{
	public:
		RigidPoly();
		RigidPoly( D3DDevice, RigidBody const &, Polygon const &, float4 const & color );

		Polygon polygon() const;
		void setup( D3DDevice, Polygon const &, float4 const & );

		// IDynamic overrides
		virtual void step( float dt );
		virtual void render( float dt );

		// IRigidCollider overrides
		virtual void collide( IRigidCollider * );
		void collide( RigidPoly * );
		void collide( RigidCircle * );

	public:
		RigidBody rigidBody;

	private:
		Polygon		m_poly;
		PolygonView	m_view;
	};
}
